#include <gtest/gtest.h>
#include <iostream>
#include "Variable.h"
#include "Data.h"

TEST(VariableTest, BasicUsage) {
	
	Variable* v1 = Variable::createVariable("x", Data::createFloat());
	ASSERT_EQ(v1->getName(), "x");
	ASSERT_EQ(v1->getFloatValue(), 0.0f);
	
	Variable* v2 = Variable::createVariable("y", Data::createFloat(4.2f));
	ASSERT_EQ(v2->getFloatValue(), 4.2f);
	
}

TEST(VariableTest, Assigning) {
	
	Variable* v1 = Variable::createVariable("x", Data::createFloat());
	v1->setData(Data::createFloat(4.5f));
	
	Variable* v2 = Variable::createVariable("y", Data::createFloat());
	v2->setData(v1->getCopyOfData());
	
	ASSERT_FLOAT_EQ(v2->getFloatValue(), 4.5f);
}










